/*Problem Id:1001  User Id:team01 
Memory:20K  Time:15MS
Language:C++  Result:Accepted

	problem name: Speed Limit
	source : Mid-Central USA 2004 
	problem type: 简单题
	
	date : 2005.4.23 北师大校内比赛
	


*/
#include<stdio.h>

void main()
{
	int n,miles;
	int i;
	int time[11]={0},speed[11]={0};


	while(1)
	{
	
	
		scanf("%d",&n);
		if(n==-1) break;

		miles=0;
	
		for(i=1;i<=n;i++)
		{
		   	scanf("%d %d",&speed[i],&time[i]);
		}

		for(i=0;i<=n;i++)
		{
			miles+=speed[i]* ( time[i] - time[i-1] );
		}

		printf("%d miles\n",miles);



	}



}

